-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use golden package for unit test 🐐 #623
Conversation
6738f69
to
3be5b71
Compare
What about a script or makefile target that would generate those golden files? |
Yeah it's the next step 😝 |
b970fdd
to
6194780
Compare
hack/update-golden.sh
Outdated
@@ -0,0 +1,2 @@ | |||
#!/usr/bin/env bash | |||
go test $(go list -f '{{ .ImportPath }} {{ .TestImports }}' ./... | grep golden | awk '{print $1}' | tr '\n' ' ') -test.update-golden=true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a comment on what it does? this look like cryptic to me 🙇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol ok 😅
6194780
to
9ef51fe
Compare
/retest |
9ef51fe
to
7fb6df9
Compare
/lgtm Looking Good! |
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This allow to remove the potential long expected output from the test code. See gotest.tools/v3/golden for documentation. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
Errors should be ignored when running this 👼 Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
7fb6df9
to
cd7c83e
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Changes
This allow to remove the potential long expected output from the test
code. See gotest.tools/v3/golden for documentation.
/cc @chmouel
Signed-off-by: Vincent Demeester vdemeest@redhat.com
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make docs
andmake man
if needed.make check
See the contribution guide
for more details.